package com.archerdu.apply.dao.hibernate;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;

import com.archerdu.apply.dao.QuestionDAO;
import com.archerdu.apply.model.Question;
import com.archerdu.base.dao.HibernateBaseDao;

public class QuestionDAOImpl extends HibernateBaseDao<Question, Integer> implements
        QuestionDAO {

    private static final long serialVersionUID = 4525546291232047831L;

	@Override
	public List<Question> findByExaminId( Integer id ) {

		DetachedCriteria criteria = getCriteria();
		criteria.add( Restrictions.eq( EXAMIN_ID, id ) );
		return findAll( criteria );
	}
}
